package com.dream.testtubebaby.data.bbs;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 15-8-16.
 */
public class BbsNode implements Serializable {
	private int id;
	private String title;
	private int viewCount;
	private int replyCount;

	private long postUserId = -1;
	private String postUserName = "";
	private int avatar = 0;
	private int open = 1;
	private long postDate = 0;
	private String content;
	private String[] imgurl;
	private List<HotNode> hotNodes = new ArrayList<HotNode>();
	private int bbstype;

	public BbsNode() {
	};

	public BbsNode(int id, String title, int viewCount, int replyCount,
			long postUserId, String postUserName, int avatar, int open,
			long postDate, String content, String[] imgurls) {
		this.id = id;
		this.title = title;
		this.viewCount = viewCount;
		this.replyCount = replyCount;
		this.postUserId = postUserId;
		this.postUserName = postUserName;
		this.avatar = avatar;
		this.open = open;
		this.postDate = postDate;
		this.content = content;
		this.imgurl = imgurls;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setViewCount(int viewCount) {
		this.viewCount = viewCount;
	}

	public void setReplyCount(int replyCount) {
		this.replyCount = replyCount;
	}

	public void setPostUserId(long postUserId) {
		this.postUserId = postUserId;
	}

	public void setPostUserName(String postUserName) {
		this.postUserName = postUserName;
	}

	public void setAvatar(int avatar) {
		this.avatar = avatar;
	}

	public void setOpen(int open) {
		this.open = open;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public void setHotNodes(List<HotNode> hotNodes) {
		this.hotNodes = hotNodes;
	}

	public int getBbstype() {
		return bbstype;
	}

	public void setBbstype(int bbstype) {
		this.bbstype = bbstype;
	}

	public String[] getImgurl() {
		return imgurl;
	}

	public void setImgurl(String[] imgurl) {
		this.imgurl = imgurl;
	}

	public long getPostDate() {
		return postDate;
	}

	public void setPostDate(long postDate) {
		this.postDate = postDate;
	}

	public String getTitle() {
		return title;
	}

	public int getReplyCount() {
		return replyCount;
	}

	public int getViewCount() {
		return viewCount;
	}

	public String getPostUserName() {
		return postUserName;
	}

	public int getAvatar() {
		return avatar;
	}

	public long getPostUserId() {
		return postUserId;
	}

	public int getOpen() {
		return open;
	}

	public int getId() {
		return id;
	}

	public void addHots(List<HotNode> hotNodes) {
		this.hotNodes = hotNodes;
	}

	public List<HotNode> getHotNodes() {
		return hotNodes;
	}

	public String getContent() {
		return content;
	}

	public static class BbsNodeBuilder {
		private int id = 0;
		private String title = "";
		private int viewCount;
		private int replyCount;

		private int postUserId = -1;
		private String postUserName = "";
		private int avatar = 0;
		private int open = 0;
		private long postDate = 0;
		private String content;
		private String[] imgurl;

		public BbsNodeBuilder() {

		}

		public BbsNodeBuilder Id(int id) {
			this.id = id;
			return this;
		}

		public BbsNodeBuilder Title(String title) {
			this.title = title;
			return this;
		}

		public BbsNodeBuilder ViewsCount(int viewCount) {
			this.viewCount = viewCount;
			return this;
		}

		public BbsNodeBuilder ReplyCount(int replyCount) {
			this.replyCount = replyCount;
			return this;
		}

		public BbsNodeBuilder PostUserId(int postUserId) {
			this.postUserId = postUserId;
			return this;
		}

		public BbsNodeBuilder PostUserName(String postUserName) {
			this.postUserName = postUserName;
			return this;
		}

		public BbsNodeBuilder Avatar(int avatar) {
			this.avatar = avatar;
			return this;
		}

		public BbsNodeBuilder Open(int open) {
			this.open = open;
			return this;
		}

		public BbsNodeBuilder PostDate(long postDate) {
			this.postDate = postDate;
			return this;
		}

		public BbsNodeBuilder Content(String content) {
			this.content = content;
			return this;
		}

		public BbsNodeBuilder Attach(String[] content) {
			this.imgurl = content;
			return this;
		}

		public BbsNode build() {
			return new BbsNode(id, title, viewCount, replyCount, postUserId,
					postUserName, avatar, open, postDate, content, imgurl);

		}

	}
}
